<!DOCTYPE html>
<html ng-app="app">
<head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Hello Form1</title>
    <script src="../lib/angular.js"></script>
    <script src="../lib/angular-route.js"></script>
    <script type="text/javascript">
        //angular.bootstrap();
        var Func = function (a) {
            this.a = a;
        }
        var obj = new Func(1);
        var fun = angular.bind(obj, function (i, j) {
            alert(this.a + i + j)
        }, 4, 2);

        angular.module('app', ['ngRoute']).controller('myCtrl', function ($scope) {
            $scope.user = {name: 'tom', sex: 'boy'};
            $scope.bdLink='http://www.baidu.com';
            $scope.demoSubmit = function () {
                fun();
            };
        }).run(['$rootScope','$timeout',function($rootScope,$timeout){
            $rootScope.isDisabled=true;
            $timeout(function(){
                $rootScope.isDisabled=false;
            },5000)
        }]);

    </script>
</head>
<body>
<form ng-submit="demoSubmit()" ng-controller="myCtrl">
    <p><input ng-model="user.name" required ng-minlength="3"/></p>

    <p><input ng-model="user.sex"/></p>

    <p>{{user.name}}</p>

    <p>{{user.sex}}</p>
    <button type="submit">Submit</button>

    <div>
        <p>
            <a ng-href="{{bdLink}}">百度</a>
        </p>

    </div>
</form>
<div>
    <input type="text" ng-model="someProperty" placeholder="TypetoEnable" />
    <button ng-model="button" ng-disabled="!someProperty">AButton</button>
</div>
</body>
</html>